//
//  SNMainBaseTableViewController.m
//  SinaVboc
//
//  Created by V on 29/11/2016.
//  Copyright © 2016 仁忄. All rights reserved.
//

#import "SNMainBaseTableViewController.h"
#import "SNVisitorView.h"
#import "SNOAuthViewController.h"
#import "SNUserAccountViewModel.h"

@interface SNMainBaseTableViewController ()<SNVisitorDelegate>

@end

@implementation SNMainBaseTableViewController

- (void)loadView {
    
    self.isLogin = [SNUserAccountViewModel shared].isUserLogin;
    
    if (self.isLogin) {
        
        [super loadView];
    }else {
        self.view = self.visitorView;
    }

}


- (void)viewDidLoad {
    [super viewDidLoad];
    
}


- (void)userWillLogin {
    NSLog(@"用户将要登录");
    
    SNOAuthViewController *oauthVc = [[SNOAuthViewController alloc] init];
    
    UINavigationController *naviVc = [[UINavigationController alloc] initWithRootViewController:oauthVc];
    
    [self presentViewController:naviVc animated:YES completion:nil];
    
}
- (void)userWillRegister {
    NSLog(@"用户将要注册");
}


- (SNVisitorView *)visitorView {
    
    if (!_visitorView) {
        _visitorView = [[SNVisitorView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _visitorView.delegate = self;
        
    }
    
    return _visitorView;
}





@end



















































